package org.langqiao.proxy;

import java.lang.reflect.Proxy;

public class ProxyDemo {
	
	public static void main(String[] args){
		HelloSpeaker helloSpeaker = new HelloSpeaker();
		LogHandler logHandler = new LogHandler(helloSpeaker);
		//Class cls = helloSpeaker.getClass();
		IHello iHello = (IHello) Proxy.newProxyInstance(HelloSpeaker.class.getClassLoader(), HelloSpeaker.class.getInterfaces(), logHandler);
		iHello.hello("JuLei");
	}
}
